<?php
/**
 * Created by PhpStorm.
 * User: 王新宇
 * Date: 2021/11/18
 * Time: 10:44
 */
namespace app\admin\model;

use think\Model;
use think\facade\View;

class Vip extends Model
{
    //获取器
    public function getSexAttr($v,$d)
    {
        return $v?'男':'女';
    }
    //搜索器
    public function searchKeywordsAttr($q,$v)
    {
        $q->where('uname','like',"%{$v}%");
    }

    protected $table ='ecm_user';
    public static function getUserList($where)
    {
      $list = Vip::
      withSearch(array_keys($where),$where)->
      paginate([
          'list_rows'=>2,
          'query'=>$where
      ]);
      return $list;
    }
}